﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <script src="device.js"></script>
</head>
<body>  
   
</body>
</html>
<script type="text/javascript">
    var num;
    if (device.mobile()) {
        num = "我的是手机";
    }
    else if (device.ipad()) {
        num = "哈哈，我是土豪！";
    }
    else {
        num = "我的设备是电脑~";
    }
    alert(num);
</script>